package com.czxy.service;

import com.czxy.dao.UserDao;
import com.czxy.domain.User;

import java.util.List;

public class UserService {
    private UserDao ud=new UserDao();
    public User login(User user){
        if (user==null){
            return null;
        }
        List<User> list = ud.findAll();
        for (User u : list) {
            if (u.getName().equals(user.getName())&&u.getPassword().equals(user.getPassword())){
                return u;

            }
        }
        return null;
    }
}
